package cn.yunhe.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import cn.yunhe.biz.ProvinceBiz;
import cn.yunhe.entity.Province;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Scope(value="prototype")
@ParentPackage(value = "struts-default")
public class ProvinceAction extends ActionSupport {
	@Autowired
	@Qualifier("provinceBiz")
	private ProvinceBiz provinceBiz;
	@Action(value="province", results={
	@Result(name="success",location="/succ.jsp")
	})
	public String erachProvince(){
		List<Province> list=provinceBiz.searchProvince();
		Map request=(Map) ActionContext.getContext().get("request");
		request.put("list", list);
		return SUCCESS;
	}
	public ProvinceBiz getProvinceBiz() {
		return provinceBiz;
	}
	public void setProvinceBiz(ProvinceBiz provinceBiz) {
		this.provinceBiz = provinceBiz;
	}
	
}
